home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Taifun
/
Taifun 143 (1990-08-15)(Ossowski, Stefan)(DE)(PD).zip
/
Taifun 143 (1990-08-15)(Ossowski, Stefan)(DE)(PD).adf
/
SASTools
/
VirusTools
/
KillRLE.asm
< prev
next >
Wrap
Assembly Source File
|
1990-05-16
|
4KB
|
115 lines
****************************************************************************
* Programme : KillRLE.asm *
* Usage : KillRLE *
* Version : V1.00 *
* Date : 07.02.1990 *
* Author : Jörg Sixt *
* Purpose : Checks and kills "Revenge of the Lamer Exterminator" *
* Language : A68K-Assembler,Blink from Fish 110 *
* Bugs : accept no arguments *
****************************************************************************
SECTION BEGIN,CODE
EXECBASE: EQU $4
OPENLIBRARY: EQU -$228
CLOSELIBRARY: EQU -$19E
OUTPUT: EQU -$3C
OPEN: EQU -$1E
CLOSE: EQU -$24
READ: EQU -$2A
WRITE: EQU -$30
SEEK: EQU -$42
DELETEFILE: EQU -$48
MODE_READWRITE: EQU 1004
OFFSET_BEGINNING: EQU -$1
OPENLIB: MACRO
lea \1,a1
moveq #0,d0
jsr OPENLIBRARY(a6)
move.l d0,\2
beq \3
ENDM
CLOSELIB: MACRO
lea \1,a1
jsr CLOSELIBRARY(a6)
ENDM
PRINT: MACRO
move.l Outhandle,d1
move.l \1,d2
move.l \2,d3
jsr WRITE(a5)
ENDM
Begin: move.l EXECBASE,a6
OPENLIB Dosname,a5,#End
jsr OUTPUT(a5)
move.l d0,Outhandle
beq End
move.l #sssName,d1
move.l #MODE_READWRITE,d2
jsr OPEN(a5)
move.l d0,d1
beq openError
move.l d0,handle
move.l #Buffer,d2
move.l #5,d3
jsr READ(a5)
lea RLE,a0
lea Buffer,a1
move.l #4,d0
CompareLoop: cmpm.b (a0)+,(a1)+
bne sssClose
dbf.s d0,CompareLoop
PRINT #RLEMess,#101
move.l handle,d1
move.l #0,d2
move.l #OFFSET_BEGINNING,d3
jsr SEEK(a5)
move.l handle,d1
move.l #KillBuf,d2
move.l #5,d3
jsr WRITE(a5)
cmp.l #5,d0
bne killError
move.l #VirName,d1
jsr DELETEFILE(a5)
tst.l d0
beq killError
sssClose: move.l handle,d1
jsr CLOSE(a5)
End: move.l #0,d0
rts
openError: PRINT #openErrMess,#29
bra End
killError: PRINT #killErrMess,#18
bra sssClose
SECTION VARS,BSS
even
Outhandle: ds.l 1
handle: ds.l 1
Buffer: ds.b 5
SECTION CONST,DATA
even
Dosname: dc.b 'dos.library',0
sssName: dc.b ':s/startup-sequence',0
VirName: dc.b ':'
RLE: dc.b $A0,$A0,$A0,$A0,$A0,0
RLEMess: dc.b 'The disk is infected with the "Revenge of the',10
dc.b 'Lamer Exterminator". I kill him now. Make a reset then',10
KillBuf: dc.b $20,$20,$20,$20,$20
openErrMess: dc.b 'Can`t open startup-sequence!',10
killErrMess: dc.b 'Can`t kill virus!',10
END